<%@ page language="java" %>

<%@ page import="com.scalar.chiptrack.utils.ConfigManager,
                 com.scalar.chiptrack.commons.Constants,
                 com.scalar.chiptrack.users.User,
                 com.scalar.chiptrack.users.Functionality,
                 com.scalar.chiptrack.operations.process.ProcessTypes"%>
<%@ page import="org.apache.struts.util.LabelValueBean" %>
<%@ page import="java.util.ArrayList" %>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>

<chiptrack:checkLogon sourcePage="/specificationFileSetup.do" />
<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>
<HTML>
<HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type="text/css" rel="stylesheet">

</HEAD>
<BODY bgColor="#ffffff" leftMargin="0" topMargin="0" marginheight="0" marginwidth="0">

<SCRIPT language="JavaScript">

</SCRIPT>
<!-- Top Header Start-->
<%@ include file="/jsp/includes/header.jsp" %>
<!-- Top Header End-->

<TABLE cellSpacing=0 cellPadding=0 width="100%" border="0">
  <TBODY>
  <TR>
	<TD width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

    <!-- Side Navigation start -->
    <%@ include file="/jsp/operations/releaseMenu.jsp" %></TD>
    <!-- end of the side navigations -->

    <TD bgcolor="#ffffff">
    <IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
    <TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
    <TD valign="top" width="100%">

    <IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
    <BR>

   	<html:form name="specificationFileSetupForm" action="/specificationFileSetup" method="POST" enctype="multipart/form-data" type="com.scalar.chiptrack.operations.release.forms.SpecificationFileSetupForm" scope="request">
        <input type="hidden" name="action" value="">
        <TABLE width='95%' align=right cellpadding='0' cellspacing='0' border='0'>
            <TR><TD class="NArialW" align=center>Specification File Setup View</td></tr>
            <TR><TD><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></TD></TR>
            <tr><td align="left" class='NArialL'>&nbsp;<FONT id="errors" color='FF0000'></font></td></tr>
            <TR><TD><chiptrack:errors styleClass="NArialL"/></TD></TR>
            <TR><TD><chiptrack:info styleClass="NArialL"/></TD></TR>
             <logic:equal name="showMessage" value="TRUE">
                <TR><TD><FONT class='NArialS'color='blue'><B><%=Constants.NO_MODIFY_RIGHTS %></B></FONT></TD></TR>
            </logic:equal>
            <TR><TD><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></TD></TR>

            <TR>
                <TD width="100%">
                    <TABLE border="0" width="100%">
                        <TR>
                           <TD class='NArialL' width='25%'>Select the Process Type :<br></TD>
                            <TD class="NArialL" width='75%'>
                                <html:select property="processName" styleClass="txfield" disabled="true">
                                    <html:option value="">-----Select-----</html:option>
                                    <html:option value="Sort">Sort</html:option>
                                    <html:option value="Assembly">Assembly</html:option>
                                    <html:option value="Test">Test</html:option>
                                </html:select>
                            </TD>
                        </TR>
                    </TABLE>
                </TD>
			</TR>
            <nested:notEqual name="specificationFileSetupForm" property="processName" value="">
            <TR><TD>&nbsp;</TD></TR>

            <TR>
                <TD width="100%">
                  <TABLE border="0" width="100%">
                        <TR>
                            <TD width="25%" class="NArialL">Specification File Name: <b><FONT color="red">*</FONT></b></TD>
                            <TD width="25%" class="NArialL">
                                <nested:text  property="specifincationFileName" size="25" disabled="true" styleClass="txfield" maxlength="50" name="specificationFileSetupForm" />
                            </TD>
                            <TD width="25%" class="NArialL">Revision Number: </TD>
                            <TD width="25%" class="NArialL">
                                <nested:text  property="revisionNumber" size="25" disabled="true" styleClass="txfield" maxlength="50" name="specificationFileSetupForm" />
                            </TD>
                        </TR>
						<nested:equal property="processName" value="Assembly">
                            <TR>
                            <TD width="25%" class="NArialL"><bean:message key="label.operation.release.assm.bomSpecFile"/>:</TD>
                            <TD width="25%" class="NArialL">
                                <nested:text  property="bom_spec" size="25" disabled="true" styleClass="txfield" maxlength="100"/>
                            </TD>
                            <TD width="25%" class="NArialL"><bean:message key="label.operation.release.assm.bomSpecFileRevNo"/>:</TD>
                            <TD width="25%" class="NArialL">
                                <nested:text  property="bom_spec_rev" size="25" disabled="true" styleClass="txfield" maxlength="50" />
                            </TD>
                            </TR>
                            <TR>
                            <TD width="25%" class="NArialL"><bean:message key="label.operation.release.assm.markingSpecFile"/>:</TD>
                            <TD width="25%" class="NArialL">
                                <nested:text  property="marking_spec" size="25" disabled="true" styleClass="txfield" maxlength="100"/>
                            </TD>
                            <TD width="25%" class="NArialL"><bean:message key="label.operation.release.assm.markingSpecFileRevNo"/>:</TD>
                            <TD width="25%" class="NArialL">
                                <nested:text  property="marking_spec_rev" size="25" disabled="true" styleClass="txfield" maxlength="50" />
                            </TD>
                            </TR>
                            <TR>
                            <TD width="25%" class="NArialL"><bean:message key="label.operation.release.assm.buildSpecFile"/>:</TD>
                            <TD width="25%" class="NArialL">
                                <nested:text  property="build_spec" size="25" disabled="true" styleClass="txfield" maxlength="100"/>
                            </TD>
                            <TD width="25%" class="NArialL"><bean:message key="label.operation.release.assm.buildSpecFileRevNo"/>:</TD>
                            <TD width="25%" class="NArialL">
                                <nested:text  property="build_spec_rev" size="25" disabled="true" styleClass="txfield" maxlength="50" />
                            </TD>
                            </TR>
                        </nested:equal>
                        <nested:equal name="specificationFileSetupForm" property="processName" value="Test">
                        <%--<TR>
                            <TD width="25%" class="NArialL">Test Program Name:</TD>
                            <TD width="25%" class="NArialL">
                                <nested:text  property="postAssemblyTest" size="25" disabled="true" styleClass="txfield" maxlength="50" name="specificationFileSetupForm" />
                            </TD>
                            <TD width="25%" class="NArialL">Test Revision Number:</TD>
                            <TD width="25%" class="NArialL">
                                <nested:text  property="postAssemblyTestRev" size="25" disabled="true" styleClass="txfield" maxlength="50" name="specificationFileSetupForm" />
                            </TD>
                        </TR>
                        <TR>
                            <TD width="25%" class="NArialL">Hot Test Flow:</TD>
                            <TD width="25%" class="NArialL">
                                <nested:text  property="hotTest" size="25" disabled="true" styleClass="txfield" maxlength="50" name="specificationFileSetupForm" />
                            </TD>
                            <TD width="25%" class="NArialL">Room Temp Flow:</TD>
                            <TD width="25%" class="NArialL">
                                <nested:text  property="roomTempFlow" size="25" disabled="true" styleClass="txfield" maxlength="50" name="specificationFileSetupForm" />
                            </TD>
                            --%><%--<TD width="25%" class="NArialL">Hot Test Revision Number:</TD>
                            <TD width="25%" class="NArialL">
                                <nested:text  property="hotTestRev" size="25" disabled="true" styleClass="txfield" maxlength="50" name="specificationFileSetupForm" />
                            </TD>--%><%--
                        </TR>
                        <TR>
                            <TD width="25%" class="NArialL">QA Test Flow:</TD>
                            <TD width="25%" class="NArialL">
                                <nested:text  property="qaTest" size="25" disabled="true" styleClass="txfield" maxlength="50" name="specificationFileSetupForm" />
                            </TD>
                            --%><%--<TD width="25%" class="NArialL">QA Test Revisin Number:</TD>
                            <TD width="25%" class="NArialL">
                                <nested:text  property="qaTestRev" size="25" disabled="true" styleClass="txfield" maxlength="50" name="specificationFileSetupForm" />
                            </TD>--%><%--
                        </TR>--%>
                        </nested:equal>
                        <nested:equal property="processName" value="Sort">
                            <TR>
                            <TD width="25%" class="NArialL">Test Program Name:</TD>
                            <TD width="25%" class="NArialL">
                                <nested:text  property="testProgramName" size="25" disabled="true" styleClass="txfield" maxlength="100"/>
                            </TD>
                            <TD width="25%" class="NArialL">Test Program Revision:</TD>
                            <TD width="25%" class="NArialL">
                                <nested:text  property="testProgramRevision" size="25" disabled="true" styleClass="txfield" maxlength="50" />
                            </TD>
                            </TR>
                            <TR>
                                <TD width="25%" class="NArialL">Test Flow:</TD>
                                <TD width="25%" class="NArialL">
                                    <nested:text  property="testFlow" size="25" disabled="true" styleClass="txfield" maxlength="100" />
                                </TD>
                                <TD width="25%" class="NArialL"></TD>
                                <TD width="25%" class="NArialL"></TD>
                            </TR>
                        </nested:equal>
                  </TABLE>
                </TD>
			</TR>
            <TR><TD>&nbsp;</TD></TR>
            <TR>
                <TD>
                    <TABLE border="0" width="60%">
                    <TR>
                        <TD width="25%" class="NArialL" bgcolor="#993333" nowrap><font class="NArialL"><font color="#FFFFFF">Select</font></font></TD>
                        <TD width="25%" class="NArialL" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF"><nested:write name="specificationFileSetupForm" property="processName"/>&nbsp;Part&nbsp;Number</font></font></TD>
                        <td width="25%" align="center" class="NArialL" bgcolor="#993333" nowrap>
                                    <font class="NArialL"><font color="#FFFFFF">Default</font></font>
                        </td>
                        <TD width="25%" class="NArialL" bgcolor="#993333" nowrap><font color="#FFFFFF">Vendor</font></td>
                    </TR>
                    <%
                        ArrayList vendorList = (ArrayList) request.getAttribute("vendorList");
                        vendorList.add(0, new LabelValueBean("All Vendors", "0"));
                    %>
                    <nested:iterate id="partNumber"  name="specificationFileSetupForm" property="lineItemList" type="com.scalar.chiptrack.operations.release.SpecificationFileSetupPartNumber">
                    <TR>
                        <TD width="25%" class="NArialL" bgcolor="#DEE1E2"><nested:checkbox property="selected" disabled="true" styleClass="txfield"/></TD>
                        <TD width="25%" class="NArialL" disabled="true" bgcolor="#DEE1E2">
                            <nested:write property="partNumber"/>
                        </TD>
                        <td width="25%" class="NArialL" bgcolor="#DEE1E2" align="middle">
                            <nested:checkbox property="defaultSelected" disabled="true" styleClass="txfield"/>
                        </td>
                        <td width="25%" class="NArialL" bgcolor="#DEE1E2" nowrap>
                        <%
                            int[] vendorId = partNumber.getVendorId();
                            if (vendorId == null) {
                                out.println("All Vendors");
                            } else {
                                for (int i = 0; i < vendorId.length; i++) {
                                    for (int j = 0; j < vendorList.size(); j++) {
                                        LabelValueBean vendor = (LabelValueBean) vendorList.get(j);
                                        if (vendor.getValue().equals(vendorId[i] + "")) {
                                            out.println(vendor.getLabel() + "<BR>");
                                        }
                                    }
                                }
                            }
                        %>
                        </td>
                        <nested:hidden property="processStep_Id"/>
                    </TR>
                    </nested:iterate>
                   </TABLE>
                </TD>
            </TR>
            <TR>
                <TD width="100%">
                    <TABLE width="75%">
                        <td width="100%" align=center>
                        &nbsp;<a href="<%=chipTracContext%>/specificationFileSetup.do" onmouseover="window.status='Click to Cancel';return true" onmouseout="window.status='';return true"  title="Click here to Cancel"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/cancel.gif" width="53" height="17"></a>
                        </td>
                    </TABLE>
                </TD>
            </TR>
            </nested:notEqual>
            <TR><TD>&nbsp;</TD></TR>
            <TR height="30"><TD colspan="4">&nbsp;</TD></TR>
        </TABLE>
        </html:form>
        <!-- till here -->
        <BR><BR><BR></TD>
        <TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
    </TR>
</TABLE>

<!-- Footer starts here -->
<%@ include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->

</BODY>
</HTML>
